//vue异步组件和webpack的【代码分块点】功能结合，实现了按需加载
import App from '../App'

//登录注册
const login = () => import(/* webpackChunkName:'login'*/"../page/login/login");
//忘记密码
const forget = () => import(/* webpackChunkName:'forget'*/"../page/forget/forget");
//修改密码
const modifypwd = () => import(/* webpackChunkName:'midifypwd'*/"../page/modify/modifypwd");
const setPwd = () => import(/* webpackChunkName:'setPwd'*/"../page/forget/setPwd");
//首页
const index = () => import(/* webpackChunkName:'index'*/"../page/index/index");
const worklist = () => import(/* webpackChunkName:'worklist'*/"../page/index/work/worklist");
const mine = () => import(/* webpackChunkName:'mine'*/"../page/index/mine/mine");
//个人资料
const material = () => import(/* webpackChunkName:'material'*/"../page/material/material");
//客服
const service = () => import(/* webpackChunkName:'service'*/"../page/service/service");

//招工
const applyrecord = () => import(/* webpackChunkName:'applyrecord'*/"../page/work/applyrecord");
const citylist = () => import(/* webpackChunkName:'citylist'*/"../page/work/citylist");
const worksearch = () => import(/* webpackChunkName:'worksearch'*/"../page/work/worksearch");
const workdetail = () => import(/* webpackChunkName:'workdetail'*/"../page/work/workdetail");

//管理
const manage = () => import(/* webpackChunkName:'manage'*/"../page/manage/index");
const applymemo = () => import(/* webpackChunkName:'applymemo'*/"../page/manage/apply/applymemo");
const issuework = () => import(/* webpackChunkName:'issuework'*/"../page/manage/issue/issuework");
const workedit = () => import(/* webpackChunkName:'workedit'*/"../page/manage/edit/workedit");
const workbreif = () => import(/* webpackChunkName:'workbreif'*/"../page/manage/edit/workbreif");
const foodexplain = () => import(/* webpackChunkName:'foodexplain'*/"../page/manage/edit/foodexplain");
const salaryexplain = () => import(/* webpackChunkName:'salaryexplain'*/"../page/manage/edit/salaryexplain");
const workexplain = () => import(/* webpackChunkName:'workexplain'*/"../page/manage/edit/workexplain");
const workpreview = () => import(/* webpackChunkName:'workpreview'*/"../page/manage/edit/workpreview");
const choosecompany = () => import(/* webpackChunkName:'choosecompany'*/"../page/manage/edit/choosecompany");
const workpublish = () => import(/* webpackChunkName:'workpublish'*/"../page/manage/edit/workpublish");

export default [{
  path: '/',
  component: App, //顶层路由，对应index.html
  children: [ //二级路由，对应App.vue
    {
      path: "",
      redirect: "/worklist"
    },
    {
      path: '/login',
      component: login,
      meta: {
        title: '登录注册'
      }
    },
    {
      path: '/forget',
      component: forget,
      meta: {
        title: '忘记密码'
      }
    },
    {
      path: '/setPwd',
      component: setPwd,
      meta: {
        title: '修改密码'
      }
    },
    {
      path: '/index',
      component: index,
      meta: {
        title: '个人中心'
      },
      children: [
        {
          path: "/worklist",
          component: worklist,
          name: "首页",
          meta: {
            title: '首页'
          }
        },
        {
          path: '/mine',
          component: mine,
          name: "个人",
          meta: {
            title: '个人'
          }
        },
        {
          path: '',
          redirect: '/mine'
        },
      ]
    },
    {
      path: '/material',
      component: material,
      meta: {
        title: '个人资料'
      }
    },
    {
      path: '/service',
      component: service,
      meta: {
        title: '客服'
      }
    },
    {
      path: '/modifypwd',
      component: modifypwd,
      meta: {
        title: '修改密码'
      }
    },
    {
      path: '/applyrecord',
      component: applyrecord,
      meta: {
        title: '报名记录'
      }
    },
    {
      path: '/citylist',
      component: citylist,
      meta: {
        title: '区域选择'
      }
    },
    {
      path: '/worksearch',
      component: worksearch,
      meta: {
        title: '搜索'
      }
    },
    {
      path: '/workdetail',
      component: workdetail,
      meta: {
        title: '招聘详情'
      }
    },
    {
      path: '/manage',
      component: manage,
      meta: {
        title: '报名记录'
      },
      children: [
        {
          path: "/applymemo",
          component: applymemo,
          name: "报名记录",
          meta: {
            title: '报名记录'
          }
        },
        {
          path: '/issuework',
          component: issuework,
          name: "发布招聘",
          meta: {
            title: '发布招聘'
          }
        },
        {
          path: '',
          redirect: '/applymemo'
        },
      ]
    },
    {
      path: '/workedit',
      component: workedit,
      meta: {
        title: '招聘编辑'
      }
    },
    {
      path: '/workbreif',
      component: workbreif,
      meta: {
        title: '企业简介'
      }
    },
    {
      path: '/foodexplain',
      component: foodexplain,
      meta: {
        title: '食宿说明'
      }
    },
    {
      path: '/salaryexplain',
      component: salaryexplain,
      meta: {
        title: '薪资说明'
      }
    },
    {
      path: '/workexplain',
      component: workexplain,
      meta: {
        title: '招聘要求'
      }
    },
    {
      path: '/workpreview',
      component: workpreview,
      meta: {
        title: '招聘预览'
      }
    },
    {
      path: '/workpublish',
      component: workpublish,
      meta: {
        title: '招聘预览'
      }
    },
    {
      path: '/choosecompany',
      component: choosecompany,
      meta: {
        title: '企业选择'
      }
    }
  ]
}]



